import React, { Component } from 'react'
import Header from '@/components/Header'
import Footer from '@/components/Footer'
import { BackTop, ConfigProvider, Icon } from 'antd'
import { addTodayVisitor } from '@/services/common'
import zhCN from 'antd/es/locale/zh_CN'
export default class Layouts extends Component {
  componentDidMount() {
    addTodayVisitor()
  }
  render() {
    return (
      <ConfigProvider locale={zhCN}>
        <Header />
        <div className="main" style={{ minHeight: 'calc(100vh - 7.5rem)' }}>
          {this.props.children}
        </div>
        <Footer />
        <BackTop visibilityHeight={300}>
          <div
            style={{
              height: 40,
              width: 40,
              borderRadius: 10,
              backgroundColor: '#1088e9',
              color: '#fff ',
              textAlign: 'center',
              fontSize: 25,
            }}
          >
            <Icon type="rocket" />
          </div>
        </BackTop>
      </ConfigProvider>
    )
  }
}
